package com.allan.springboot_wms.config;

import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;

@ComponentScan("com.allan")
@SpringBootApplication
@MapperScan("com.allan.springboot_wms.mapper")
public class SpringbootWmsApplication {

    private static final Logger LOG =LoggerFactory.getLogger(SpringbootWmsApplication.class);

    public static void main(String[] args) {
        SpringApplication app = new SpringApplication(SpringbootWmsApplication.class);
        Environment env = app.run(args).getEnvironment();
        LOG.info("启动成功了！");
        LOG.info("地址：\thttp://localhost:{}", env.getProperty("server.port"));

        //一启动就打开浏览器
        try {
            Runtime.getRuntime().exec("cmd /c start http://localhost:80");
        } catch (Exception e) {
            e.printStackTrace();
        }


    }

}
